home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 465 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.2 KB

  1. From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
  2. Date: Mon, 6 Sep 93 10:47:14 +0200
  3. Message-Id: <9309060847.AA20734@issan.informatik.uni-dortmund.de>
  4. To: mint@atari.archive.umich.edu
  5. Subject: More bugs in MiNT 1.09
  6.  
  7. zero() can produce an address error on an 68000 when the size of the
  8. block is uneven.
  9.  
  10. load_region() can pass a non-word-aligned block to zero().
  11.  
  12. --- orig/mem.c    Tue Aug 17 21:23:24 1993
  13. +++ mem.c    Sat Sep  4 22:56:22 1993
  14. @@ -1145,7 +1145,18 @@
  15.          size = b->p_blen;
  16.      else
  17.          size = b->p_hitpa - b->p_bbase;
  18. -    zero((char *)b->p_bbase, size);
  19. +    if (size > 0)
  20. +      {
  21. +        /* the block passed to zero() must be word-aligned! */
  22. +        start = b->p_bbase;
  23. +        if (start & 1)
  24. +          {
  25. +        *(char *) start = 0;
  26. +        start++;
  27. +        size--;
  28. +          }
  29. +        zero((char *)start, size);
  30. +      }
  31.  
  32.      do_close(f);
  33.      *text = shtext;
  34. --- orig/util.c    Tue Aug 17 21:23:28 1993
  35. +++ util.c    Sat Sep  4 22:40:34 1993
  36. @@ -81,13 +81,14 @@
  37.  
  38.      cruft = size % 256;    /* quickzero does 256 byte blocks */
  39.      size = size / 256;
  40. +    if (size > 0) {
  41. +        quickzero(place, size);
  42. +        place += size * 256;
  43. +    }
  44.      while (cruft > 0) {
  45.          *place++ = 0;
  46.          cruft--;
  47.      }
  48. -    if (size > 0) {
  49. -        quickzero(place, size);
  50. -    }
  51.  }
  52.  
  53.  #ifdef JUNK_MEM
  54.